Repository navigation
COPY, MOVE and the time of a file in the backend contract - #35
Merged
Merged
Conversation
New commands, with the output, the log and the exit codes of rclone: - mkdir, delete (with --rmdirs), deletefile, purge, rmdir and rmdirs (with --leave-root). - copy and copyto, move and moveto: a file goes when the target has no file with its name, or another size, or another time in the precision of the two remotes. The flags --size-only, --ignore-times, --ignore-existing, --create-empty-src-dirs, --delete-empty-src-dirs, --transfers and --dry-run work. A move is a copy, then the delete of each source file. - size (with --json), tree (with the flags of the tree of rclone, and its quirks: no names with "." at the start, and no count of the folders with no file), touch, listremotes (with --long and --json), version and cryptdecode (with --reverse). - md5sum, sha1sum and hashsum: MD5, SHA-1, SHA-256, SHA-512 and CRC-32, with --base64, --output-file and --checkfile. The backends give no hash: thus rfetch reads each file, as --download of rclone. - check, checksum and cryptcheck: the lists of --combined, --match, --differ, --missing-on-src, --missing-on-dst and --error. check compares the sizes, as rclone with no common hash, and the bytes with --download. copy now has the semantics of rclone: the contents of a source folder, or a source file, go in the target folder. The old copy of one file to a name is copyto. The backends cannot set the time of a file yet: thus touch of a file that exists gives the error of rclone, and a second copy sends the files again, unless --size-only. The shared code is in cmd/operations.js: stat, walk, copyFile, remove, mkdir, the log on the standard error, and OperationError. lsjson gives its walk to the other commands with listItems. A command with an output and an error gives the error in statusText. The command line gives the exit code 4 for "object not found". cmd/rclone_test.js runs each command with rfetch and with rclone on the same local folders, and compares the outputs, the exit codes and the files after the command.
The name tests put a file with no extension. rclone serve webdav guesses the type of such a file from its bytes. When the 64 random bytes have no control byte, the type is text/plain, and the test fails. This occurs for about 1 file in 1250, thus CI failed on some runs. Now the content is the bytes 0 to 63. They are not text, and they are not the start of a known type of file: the type is application/octet-stream each time.
With the policy epmfs, the default create policy, rclone takes the upstream with the most free space. The upstreams of the tests are on one disk. rclone reads the free space of a, then of b. When another test deletes a file between the two reads, b has more free space, and rclone takes b. rfetch reads no free space and takes a, thus CI failed on some runs. Now rclone runs with --disable About. Then it reads no free space, and the policies of space take the first upstream, as rfetch. With b on a disk with more free space, the old tests fail each time, and the new tests pass.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add mkdir, delete, deletefile, purge, rmdir and rmdirs.
Add copy, copyto, move and moveto, with the flags of rclone, for example --size-only, --ignore-existing and --dry-run.
Add size, tree, touch, listremotes, version and cryptdecode.
Add md5sum, sha1sum and hashsum, and check, checksum and cryptcheck.
Each command has the output, the log and the exit codes of rclone.